<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="(item, index) in booksList" :key="item.id">
            <span>{{ item.name }}</span>
            <span>{{ item.author }}</span>
        </li>
    </ul>
</div>
<script src="vue.js"></script>
<script>
    /**
     * v-for的key是每一项的唯一标识
     *
     */
    const app = new Vue({
        el: '#app',
        data: {
            booksList: [
                {
                    name: '红楼梦',
                    author: '曹雪芹'
                },
                {
                    name: '西游记',
                    author: '吴承恩'
                },
            ]
        }
    })
</script>
</body>
</html>